package com.cuit.qx.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cuit.qx.bean.Threshold;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author:wjd
 * @Description:
 * @date:Created in 10:12 2020/9/17
 * @Modified By:
 */
@Mapper
public interface ThresholdManagementMapper extends BaseMapper<Threshold> {

    // 根据id单条修改阈值信息
    int updateThresholdById(Threshold threshold);

    // 根据id批量修改阈值信息
    int updateThresholdForeach(List<Threshold> thresholds);

    // 根据条件查询阈值信息(站号,站名)
    List<Threshold> getThresholdData(@Param("pageNo") Integer pageNo, @Param("pageSize") Integer pageSize,
                                     @Param("station") String station, @Param("stationName") String stationName);

    // 根据阈值id删除站点信息
    int deleteThresholdById(@Param("id") String id);

    // 根据阈值id批量删除站点信息
    int deleteThresholdByIds(String[] ids);

    @Select("SELECT * FROM threshold ")
    List<Threshold> getByState();

}
